package com.ruoyi.ring.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ring.mapper.RingRelaxFrequencyMapper;
import com.ruoyi.ring.domain.RingRelaxFrequency;
import com.ruoyi.ring.service.IRingRelaxFrequencyService;

/**
 * 减压助眠频次Service业务层处理
 * 
 * @author liuwp
 * @date 2025-10-22
 */
@Service
public class RingRelaxFrequencyServiceImpl implements IRingRelaxFrequencyService 
{
    @Autowired
    private RingRelaxFrequencyMapper ringRelaxFrequencyMapper;

    /**
     * 查询减压助眠频次
     * 
     * @param id 减压助眠频次主键
     * @return 减压助眠频次
     */
    @Override
    public RingRelaxFrequency selectRingRelaxFrequencyById(Long id)
    {
        return ringRelaxFrequencyMapper.selectRingRelaxFrequencyById(id);
    }

    /**
     * 查询减压助眠频次列表
     * 
     * @param ringRelaxFrequency 减压助眠频次
     * @return 减压助眠频次
     */
    @Override
    public List<RingRelaxFrequency> selectRingRelaxFrequencyList(RingRelaxFrequency ringRelaxFrequency)
    {
        return ringRelaxFrequencyMapper.selectRingRelaxFrequencyList(ringRelaxFrequency);
    }

    /**
     * 根据业务主键查询一条记录：减压助眠频次
     *
     * @param ringRelaxFrequency 减压助眠频次
     * @return 减压助眠频次
     */
    @Override
    public RingRelaxFrequency selectOneRingRelaxFrequency(RingRelaxFrequency ringRelaxFrequency)
    {
        return ringRelaxFrequencyMapper.selectOneRingRelaxFrequency(ringRelaxFrequency);
    }

    /**
     * 新增减压助眠频次
     * 
     * @param ringRelaxFrequency 减压助眠频次
     * @return 结果
     */
    @Override
    public int insertRingRelaxFrequency(RingRelaxFrequency ringRelaxFrequency)
    {
        ringRelaxFrequency.setCreateTime(DateUtils.getNowDate());
        return ringRelaxFrequencyMapper.insertRingRelaxFrequency(ringRelaxFrequency);
    }

    /**
     * 修改减压助眠频次
     * 
     * @param ringRelaxFrequency 减压助眠频次
     * @return 结果
     */
    @Override
    public int updateRingRelaxFrequency(RingRelaxFrequency ringRelaxFrequency)
    {
        ringRelaxFrequency.setUpdateTime(DateUtils.getNowDate());
        return ringRelaxFrequencyMapper.updateRingRelaxFrequency(ringRelaxFrequency);
    }

    @Override
    public int updateRingRelaxFrequencyCondition(RingRelaxFrequency ringRelaxFrequency, RingRelaxFrequency ringRelaxFrequencyCondition)
    {
                ringRelaxFrequency.setUpdateTime(DateUtils.getNowDate());
        return ringRelaxFrequencyMapper.updateRingRelaxFrequencyCondition(ringRelaxFrequency, ringRelaxFrequencyCondition);
    }

    /**
     * 批量删除减压助眠频次
     * 
     * @param ids 需要删除的减压助眠频次主键
     * @return 结果
     */
    @Override
    public int deleteRingRelaxFrequencyByIds(Long[] ids)
    {
        return ringRelaxFrequencyMapper.deleteRingRelaxFrequencyByIds(ids);
    }

    /**
     * 删除减压助眠频次信息
     * 
     * @param id 减压助眠频次主键
     * @return 结果
     */
    @Override
    public int deleteRingRelaxFrequencyById(Long id)
    {
        return ringRelaxFrequencyMapper.deleteRingRelaxFrequencyById(id);
    }

    /**
     * 条件删除减压助眠频次
     *
     * @param ringRelaxFrequency 减压助眠频次
     * @return 结果
     */
    @Override
    public int deleteRingRelaxFrequencyByCondition(RingRelaxFrequency ringRelaxFrequency)
    {
        return ringRelaxFrequencyMapper.deleteRingRelaxFrequencyByCondition(ringRelaxFrequency);
    }

}
